package isp.apps.example.shoppingcart.action;

import com.opensymphony.xwork.ActionSupport;

import isp.apps.example.shoppingcart.persistence.CreditCardDirectory;
import isp.apps.example.shoppingcart.persistence.ShippingOptionsDirectory;

import isp.apps.example.shoppingcart.persistence.factory.CreditCardPersistenceFactory;
import isp.apps.example.shoppingcart.persistence.factory.ShippingOptionsPersistenceFactory;

import java.util.List;

public class LoadCreditCardsAction extends ActionSupport
{

  private List allCreditCardsList;
  private List validCreditCards;
  private CreditCardDirectory creditCardDir;

  public LoadCreditCardsAction()
  {
  }
  
  public String execute()
  {
    creditCardDir = CreditCardPersistenceFactory.getCreditCardDirectory();
    allCreditCardsList = creditCardDir.getCreditCards();
    validCreditCards = creditCardDir.getValidCreditCards();
    return SUCCESS;
  }

  public void setAllCreditCardsList(List allCreditCards)
  {
    this.allCreditCardsList = allCreditCards;
  }

  public List getAllCreditCardsList()
  {
    return allCreditCardsList;
  }

  public void setValidCreditCards(List validCreditCards)
  {
    this.validCreditCards = validCreditCards;
  }

  public List getValidCreditCards()
  {
    return validCreditCards;
  }
}
